if (kc>1) and ((ka$="<") or (ka$=",")) kd=kc:goto sback0
if (kc<nb) and ((ka$=">") or (ka$=".")) gosub scanforw:return
if instr(ka$,",.<>") goto move2
if ka$="S" x=40:y=bo:gosub screen:ok=0:print "Search Map Mode. <ESC> to abort ";:goto Search
if xx>xf dx=xx-xf:else dx=xf-xx
if yy>yf dy=yy-yf:else dy=yf-yy
y=yy:gosub getline1:c$=mid$(l1$,xx,1)
if (count=1) and (ka$=chr$(27)) ta=ta+1
if ka$=chr$(27) x=xx:y=yy:gosub screen:print c$;:gosub zerocoords:return
if (dx>1) or (dy>1) x=40:y=bo:gosub screen:print "Not within 1 square ";:gosub erase:xx=xf:yy=yf:gosub flsh:goto move2
if (xx=xf) and (yy=yf) gosub showchar:return
if instr(c$,"=#") x=40:y=bo:gosub screen:print "Impassable ";:gosub erase:xx=xf:yy=yf:gosub flsh:goto move2
if (c$=":") and (bt=0) x=40:y=bo:gosub screen:print "Need a boat. ";:gosub erase:xx=xf:yy=yf:gosub flsh:goto move2
if instr(aa$,c$) y=yy:gosub getline2:if mid$(l2$,xx,1)<>"0" x=40:y=bo:gosub screen:print "No stacking while moving. ";:gosub erase:xx=xf:yy=yf:gosub flsh:goto move2
if instr(c$,"ABCDEF") kk=1:else kk=0
if (kk=1) and (aa$<>c$) and (aa$<>chr$(asc(c$)+32)) goto warfare
Move3
gosub savemove
if count=1 gosub zerocoords:ta=ta+1
count=count+1:if count=1+nm gosub showchar:return
goto Move1
showchar
x=xx:y=yy:gosub screen
print aa$ ;
return
zerocoords
close #1:open #1,"h:coords"
position #1,8,kc-1:print #1,0,0
close #1:open #1,"H:WAR.MAP1"
return
savemove
if (bt=1) and (c$<>":") d$="+"
if (bt=1) and (c$=":") d$=":"
if (bt=0) and (asc(aa$)>96) d$=" "
if (asc(aa$)>64) and (asc(aa$)<91) d$=aa$
if instr(c$,pc$) goto save2
if (c$="*") or ((asc(c$)>64) and (asc(c$)<91)) ct=ct+1
save2
if (c$="*") or ((asc(c$)>64) and (asc(c$)<91)) aa$=chr$(asc(aa$)-32):else if ((asc(aa$)>64) and (asc(aa$)<91)) aa$=chr$(asc(aa$)+32)
position #1,80,yy-1,xx-1
print #1,aa$ ;
if (c$="+") and (bt=0) bb$=chr$(val(bb$)+64)
if (c$<>":") and (c$<>"+") and (bt=1) bb$=chr$(asc(bb$)-16)
position #2,80,yy-1,xx-1
print #2,bb$ ;
position #2,80,yf-1,xf-1
print #2,"0" ;
position #1,80,yf-1,xf-1
print #1,d$ ;
if ma<>mp x=xx:y=yy:gosub screen:gosub invon:print aa$;:gosub invoff:mp=ma:return